cmake_minimum_required(VERSION 3.6)
project(GeeJoanCpp)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE)
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
set(GEEJOAN_OUTPUTDIR ${CMAKE_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}.out)

# mysql 的 封装
OPTION(WITH_GEEJOAN_MYSQL_WARPPER "Support mysql warpper " OFF)
# 动态库 静态库选择 , 某人 静态库
OPTION(BUILD_SHARED_LIBS "build shared" OFF)

if (BUILD_SHARED_LIBS)
    MESSAGE(STATUS "build GeeJoan SHARED")
    set(GEEJOAN_LIBRARY_TYPE "SHARED")
    set(CMAKE_C_FLAGS "-fPIC")
    set(CMAKE_CXX_FLAGS "-fPIC")
else (BUILD_SHARED_LIBS)
    MESSAGE(STATUS "build GeeJoan STATIC")
    set(GEEJOAN_LIBRARY_TYPE "STATIC")
endif (BUILD_SHARED_LIBS)
set(CMAKE_CXX_STANDARD 14)
if (WITH_GEEJOAN_MYSQL_WARPPER)
    MESSAGE(STATUS "with use mysql warpper ...")
endif (WITH_GEEJOAN_MYSQL_WARPPER)
#初始化 模块
include_directories(libs/curve25519)
include_directories(libs/protobuf/src)
add_subdirectory(libs/curve25519)
add_subdirectory(libs/protobuf/cmake)
include_directories(common/protocol)
include_directories(common/security)
include_directories(common/tools)
if (WITH_GEEJOAN_MYSQL_WARPPER)
    include_directories(common/mysqlcpp/include)
endif (WITH_GEEJOAN_MYSQL_WARPPER)
add_subdirectory(common)
add_subdirectory(tests)


